﻿using System;
using System.Collections.Generic;
using System.Dynamic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Newtonsoft.Json;

namespace Ecobee.Net
{
	public enum AcknowledgeType
	{
		None,
		Accept,
		Decline,
		Defer,
		Unacknowledged
	}

	public class Acknowledge : ApiObject
	{
		private string _thermostatIdentifier = string.Empty;
		private string _ackRef = string.Empty;
		private AcknowledgeType _ackType = AcknowledgeType.None;
		private bool _remindMeLater = false;

		/// <summary>
		/// The thermostat identifier to acknowledge the alert for. 
		/// </summary>
		[JsonProperty(PropertyName = "thermostatIdentifier", Order = 1)]
		public string ThermostatIdentifier
		{
			get
			{
				return _thermostatIdentifier;
			}
			set
			{
				this.SetProperty(ref _thermostatIdentifier, value);
			}
		}

		/// <summary>
		/// The acknowledge ref of alert. 
		/// </summary>
		[JsonProperty(PropertyName = "ackRef", Order = 2)]
		public string AcknowledgeRef
		{
			get
			{
				return _ackRef;
			}
			set
			{
				this.SetProperty(ref _ackRef, value);
			}
		}

		/// <summary>
		/// The type of acknowledgement. Valid values: accept, decline, defer, unacknowledged.
		/// </summary>
		[JsonIgnore()]
		public AcknowledgeType AcknowledgeType
		{
			get
			{
				return _ackType;
			}
			set
			{
				this.SetProperty(ref _ackType, value);
			}
		}

		/// <summary>
		/// The type of acknowledgement. Valid values: accept, decline, defer, unacknowledged.
		/// </summary>
		[JsonProperty(PropertyName = "ackType", Order = 3)]
		public string AcknowledgeTypeString
		{
			get
			{
				return _ackType.ToString().ToLower();
			}
		}

		/// <summary>
		/// Whether to remind at a later date, if this is a defer acknowledgement. 
		/// </summary>
		[JsonProperty(PropertyName = "remindMeLater", Order = 4)]
		public bool RemindMeLater
		{
			get
			{
				return _remindMeLater;
			}
			set
			{
				this.SetProperty(ref _remindMeLater, value);
			}
		}
	}
}
